﻿using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

namespace BenchmarkDotnetSample.ConsoleApp.Tests
{
    [CoreJob,ClrJob]
    public class TestContext
    {
        private readonly string url = "http://www.jessetalk.cn/2018/03/19/net-core-apigateway-ocelot-docs/";
        [Benchmark]
        public void Test1()
        {
            using (var md5=MD5.Create())
            {
                md5.ComputeHash(Encoding.UTF8.GetBytes(url));
            }
        }
        [Benchmark]
        public void Test2()
        {
            using (var sha5=SHA256.Create())
            {
                sha5.ComputeHash(Encoding.UTF8.GetBytes(url));
            }
        }
    }
}
